home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Tools / Languages / Yerk 3.6.6 / Supplement / my stuff / late bind example < prev    next >
Encoding:
Text File  |  1991-01-01  |  1015 b   |  27 lines  |  [TEXT/MACA]

  1. \ suppose you have an array with object addresses stored in it:
  2.  
  3. 4 array objectArray
  4.  
  5. \ make three objects
  6.  
  7. var myVar
  8. int myInt
  9. rect myRect
  10. string myString
  11. new: myString
  12.  
  13. myVar myInt myRect myString put: objectArray
  14.  
  15. \ now put a few values in the objects
  16.  
  17. 12 put: myVar
  18. 10 put: myInt
  19. 10 10 100 100 put: myRect
  20. " hello" put: myString
  21.  
  22. \ now draw each object, but late bind to the objects held in the array: 
  23.  
  24.     print: [ 0 at: objectArray ]
  25.     print: [ 1 at: objectArray ]
  26.     print: [ 2 at: objectArray ]
  27.     print: [ 3 at